<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			//var arr=[[1,4,3,3, 5,6,7,4, 6,9,5,8];
			//var arr=["a","b","c","d","e","f","g"];
			var str="!你好，帅比！比帅，好你！";
			
			//var arr=[[1,4,3,3],[5,6,111,4,99,11,57],[6,9,5,8]];
			
			function s(a,b){
				return a-b;//由小到大
				//return b-a;//由大到小
				
			}
			 //var res=arr.sort(s).reverse();
			 //var res=arr.reverse();//这个方法只对数组有效
			 
			 //字符串的翻转
			 //转换
			 var res=str.split("").reverse().join("");//split分割 空字符串为 分割线 reverse翻转   //join 重新加入
			 document.write(res);
			 
			 //var newArr=arr.sort(s)
			 
			 //二维数组的排序
			 //var childArr=[];
			 //childArr=arr[0].sort(s);
			 //arr[0]=childArr;
			 
				//arr[0]=arr[0].sort(s);
				//arr[1]=arr[1].sort(s);
				//arr[2]=arr[2].sort(s);
				//循环排序
				/*for(var i of arr){
					//for(var i in arr){
					//arr[i]=arr[i].sort(s);
					i=i.sort(s);
				}
				*/
			   
			   //var newArr=arr.join(".");
			   //var newArr=arr.join(",").split(",");//数组类型？
			   
			   //复原数组 
			   //var newArr=arr.join(",").split(",").sort(s);
			   
			   //循环
			   /*var i=0;
			   for(var x in arr){
				   //var l =arr[x].length;
				   for(var y in arr[x]){
					   //var sum=x*l+y; //求和
					  // var sum=Number(x*l)+Number(y);//字符串的相加
					   //document.write(sum+"</br>");
					  arr[x][y]=newArr[i];
					  i++;
					   
				   }
				   
			   }
			   */
			  // for(var a of arr){
				   //document.write(a+"</br>");
			   //}
			   
			   /*arr[0][0]=newArr[0];
			   arr[0][1]=newArr[1];
			   arr[0][2]=newArr[2];
			   arr[0][3]=newArr[3];
			   //前面数一个乘长度?
			   arr[1][0]=newArr[4];
			   arr[1][1]=newArr[5];
			   arr[2][2]=newArr[10];
		
		
			//document.write(arr.sort(s));
			//document.write(res);
			//document.write(childArr);
			//document.write(arr);
			
			//document.write(newArr);
			//document.write(typeof(newArr));//string类型
			//document.write(newArr.sort(s));
			//document.write(newArr.length);
			
			//复原数组
			
			document.write(arr);
			*/
			
			
			//document.write(res);
			
	
				
		</script>
	</body>
</html>
